<template>
    <div class="home">
        Home
        <div>
            <img src="./1.png" alt="">
            <input type="text" v-model="this.num"/>
            <button @click="YieldTEst">Next</button>
        </div>
    </div>
</template>
<script>
    export default {
        name: "Home",
        data(){
            return{
                lbj:{},
                num:1
            }
        },
        methods:{
            initial:function*(x) {
                var y = 2 * (yield(x+1))
                var z = yield (y/3)
                console.log('x='+x+',y='+y+',z='+z)
                return (x+y+z)
            },
            YieldTEst(){
                console.log(this.lbj.next(this.num))
            }
        },
        mounted() {
            this.lbj = this.initial(5)
        }
    }
</script>
<style>
    .home{
        background-color: aliceblue;
    }
</style>
